<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>10-计算年龄</title>
	</head>
	<body>
		<script type="text/javascript">
			//声明一个变量去接收年龄
			var date = prompt('请输入出生日期-年');
			//隐式转换
			var age = 2022 - date;
			console.log("年龄:::",age);
			
		</script>
		
	</body>
</html>
